const config = require('./src/config')
const path = require('path')

const resolve = dir => {
  return path.join(__dirname, dir)
}

const BASE_URL = process.env.NODE_ENV === 'production'
  ? './'
  : '/'

module.exports = {
  publicPath: BASE_URL,
  outputDir: 'target/classes/META-INF/resources/',
  assetsDir: 'webjars',
  productionSourceMap: false,
  lintOnSave: process.env.NODE_ENV !== 'production',
  devServer: {
    port: 9527,
    open: true,
    overlay: {
      warnings: false,
      errors: true
    }
  },
  configureWebpack: {
    name: config.title,
    resolve: {
      alias: {
        '@': resolve('src'),
        _c: resolve('src/components'),
        _api: resolve('src/api')
      }
    }
  }
}
